<html>
<head><meta charset="utf-8"><title>announcement: rust analyzer works for developing stdlib now! · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/announcement.3A.20rust.20analyzer.20works.20for.20developing.20stdlib.20now!.html">announcement: rust analyzer works for developing stdlib now!</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="243469591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/announcement%3A%20rust%20analyzer%20works%20for%20developing%20stdlib%20now%21/near/243469591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/announcement.3A.20rust.20analyzer.20works.20for.20developing.20stdlib.20now!.html#243469591">(Jun 22 2021 at 03:48)</a>:</h4>
<p>Since today's rust analyzer nightly (which will be in a release version next Monday), r-a will be much more usable in libstd and libcore as it can now see the items in libcore properly. Like the rest of the rust repo, you should use the configuration from here for the best results: <a href="https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc">https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc</a></p>
<p>If you have any other issues, the known issues in r-a for the rust repo are tracked here, please let us know about any more that you find :)<br>
<a href="https://github.com/rust-analyzer/rust-analyzer/issues/8915">https://github.com/rust-analyzer/rust-analyzer/issues/8915</a></p>
<p>As for the cause, since rust analyzer previously hard-coded the test cfg to always be true in cargo crates, it could not see the contents of libcore, which has a <code>#![cfg(not(test))]</code>. This broke navigation and completion for items in libstd and libcore, but only when they were being accessed from a cargo workspace context (i.e. in the rust repo only). I added a config setting disabling this behaviour, which defaults to unsetting the test cfg on crates called "core".</p>



<a name="243490272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/announcement%3A%20rust%20analyzer%20works%20for%20developing%20stdlib%20now%21/near/243490272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/announcement.3A.20rust.20analyzer.20works.20for.20developing.20stdlib.20now!.html#243490272">(Jun 22 2021 at 09:17)</a>:</h4>
<p>That's amazing! Thank you so much for working on this!</p>



<a name="243567345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/announcement%3A%20rust%20analyzer%20works%20for%20developing%20stdlib%20now%21/near/243567345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/announcement.3A.20rust.20analyzer.20works.20for.20developing.20stdlib.20now!.html#243567345">(Jun 22 2021 at 19:30)</a>:</h4>
<p>the best!</p>



<a name="244382723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/announcement%3A%20rust%20analyzer%20works%20for%20developing%20stdlib%20now%21/near/244382723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/announcement.3A.20rust.20analyzer.20works.20for.20developing.20stdlib.20now!.html#244382723">(Jun 30 2021 at 06:37)</a>:</h4>
<p>This is now in the stable release as of yesterday's release.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>